package com.service.impl;

import com.service.OrderService;
import com.dao.inter.OrderDao;
import com.dao.model.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

@Service("orderService")
@Transactional
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderDao dao ;

    /**
     * 插入订单
     * @param orderbh
     * @param account
     * @param product
     */
    public void updateOrder(String orderbh, String account, Product product) {
        Map map =new HashMap<String,String>();
        map.put("orderbh",orderbh);
        map.put("account",account);
        map.put("pname",product.getName());
        map.put("id",product.getId());
        dao.insertOrder(map);
    }
}
